1. Field of the Invention
The present invention generally relates to a controller and a storage device having the same. More particularly, the present invention relates to a controller and a storage device having the same for preventing wrong error-correcting codes from occurring due to an error-correcting module during data reading operation.
2. Description of Related Art
The flash memory is popular because of its advantageous characteristics, such as low power consumption, non-volatility, shock tolerance and high storage density. The flash memory has gradually replaced an EEPROM or a battery powered memory in majority portable devices. And the mature semiconductor technology allows further increased storage density and transmission speed of the flash memory. Thus, the flash memory has successfully replaced the traditional storage media, such as the hard disk.
For maintaining completeness of the data stored in the flash memory, error-correcting codes (ECCs) are provided. The ECC is a code in which each data signal conforms to specific rules of construction so that departures from this construction in the received signal can generally be automatically detected and corrected. It is used in computer data storage, for example, in a dynamic RAM, and in data transmission. Examples include Hamming codes, BCH codes, Reed-Solomon codes, Reed-Muller codes, Binary Golay codes, convolutional codes, and turbo codes. The simplest error-correcting codes can correct single-bit errors and detect double-bit errors. Other codes can detect or correct multi-bit errors.
Generally, a unit for storing data in a memory is byte (1 byte=8 bits) and one byte is represented with two hexadecimal numbers in a computer system. In a process of fabricating a portable storage device using the flash memory as a storing medium, an erase command must be executed to convert values of data in a data area and an error-correcting code area of the flash memory into all 0xFF. However, because the error-correcting codes corresponding data having all 0xFF of values generally are not all 0xFF, the error-correcting module may determinate that there are parity errors in the data, or even worse, the reading operation cannot be executed after performing the erase operation.
Therefore, it is highly desirable to prevent the wrong determination by the error-correcting module after the erase operation is performed.